import { CITY_INIT, CITY_UPDATE, CITY_CLEAR } from "../actionTypes"
const defaultState = {
    cityname: {

    }
}
const reducer = (state = defaultState, action) => {
    if (action.type === CITY_INIT) {
        let newState = JSON.parse(JSON.stringify(state))
        newState.cityname = action.value
        return newState;
    } else if (action.type === CITY_UPDATE) {
        let newState = JSON.parse(JSON.stringify(state))
        newState.cityname = action.value
        return newState;
    } else if (action.type === CITY_CLEAR) {
        let newState = JSON.parse(JSON.stringify(state))
        newState.cityname = action.value
        return newState;
    }
    return state;
}
export default reducer;